package com.xuetang9.service.al.impl;

import com.xuetang9.dao.DefectMapper;
import com.xuetang9.domain.Defect;
import com.xuetang9.service.DefectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @describe :实现缺陷服务层实现类
 * @author: allende
 * @date: 2020/5/14 11:37
 * @vision: 1.0.0
 **/
@Service("DefectServiceAl")
public class DefectServiceImpl implements DefectService {
    @Autowired
    private DefectMapper defectMapper;

    /**
     * 添加缺陷类型
     * @param defect 需要添加的缺陷类型
     * @return 返回数据访问层
     */
    @Override
    public int insertDefectType(Defect defect) {
        return defectMapper.insertDefectType(defect);
    }

    /**
     * 查询全部缺陷
     * @return 返回数据访问层
     */
    @Override
    public List<Defect> listDefectType() {
        return defectMapper.listDefectType();
    }

    /**
     * 更新缺陷类型
     * @param defect 根据defect修改缺陷类型
     * @return 返回数据访问层
     */
    @Override
    public int updateDefectType(Defect defect) {
        return defectMapper.updateDefectType(defect);
    }

    /**
     * 更新缺陷状态
     * @param defect 根据defect修改缺陷状态
     * @return 返回数据访问层
     */
    @Override
    public int updateDefectStatus(Defect defect) {
        return defectMapper.updateDefectStatus(defect);
    }

    /**
     * 删除缺陷
     * @param id 根据id删除缺陷
     * @return 返回数据访问层
     */
    @Override
    public int deleteDefect(int id) {
        return defectMapper.deleteDefect(id);
    }
}
